package com.ternnetwork.auth.server.controller;


import javax.annotation.Resource;
import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ternnetwork.commons.model.http.BaseResponse;



/**
 * 注销登录
 * @author xuwenfeng
 *
 */
@RestController
public class LogoutController {

     @Resource
     private ConsumerTokenServices consumerTokenServices;

     @RequestMapping("/oauth/consumer/token/revoke")
	 public   BaseResponse revoke(@RequestParam(value="access_token") String accessToken) {
		 consumerTokenServices.revokeToken(accessToken);
		 BaseResponse baseResponse=new BaseResponse();
		 baseResponse.setSccucess();
		 return baseResponse;
	 }


}
